home *** CD-ROM | disk | FTP | other *** search
/ Aminet 12 / Aminet 12 (1996)(GTI - Schatztruhe)[!][Jun 1996].iso / Aminet / dev / misc / BST_SystemDocs.lha / BeastV1 / Include / BST_System / Beast.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-30  |  8.2 KB  |  331 lines

  1. #ifndef BEAST_H
  2. #define BEAST_H
  3.  
  4. /****h* Beast/Beast.h [0.1]
  5. *
  6. *    NAME
  7. *      Beast.h -- Beast types and constants
  8. *
  9. *    COPYRIGHT
  10. *      Maverick Software Development
  11. *
  12. *    FUNCTION
  13. *
  14. *    AUTHOR
  15. *      Jacco van Weert / Frans Slothouber
  16. *      GNU-C support by Jeroen Vermeulen
  17. *
  18. *    CREATION DATE
  19. *      3-May-95
  20. *
  21. *    MODIFICATION HISTORY
  22. *
  23. *    NOTES
  24. *
  25. ******
  26. */
  27.  
  28. #include <exec/types.h>
  29. #include <exec/lists.h>
  30. #include <exec/nodes.h>
  31.  
  32. typedef unsigned long BST_Method  ;
  33. typedef unsigned long BST_MethodFlags ;
  34.  
  35. #ifdef __SAS__
  36. #define rfcall(fn,p1,p2,p3) BST_MethodFlags __asm fn (register __d3 p1, register __a2 p2, register __a3 p3)
  37. #endif
  38.  
  39. #ifdef _DCC
  40. #define rfcall(fn,p1,p2,p3) BST_MethodFlags fn ( __D3 p1, __A2 p2, __A3 p3)
  41. #endif
  42.  
  43. #ifdef __GNUC__
  44. #define rfcall(fn,p1,p2,p3) BST_MethodFlags fn (void);                  \
  45.                static inline BST_MethodFlags real_ ## fn (              \
  46.                BST_MethodFlags     p1, ULONG *p2, ULONG *p3)
  47.  
  48. #define self_call(result,fn,p1,p2,p3) {                                 \
  49.         register BST_MethodFlags  selfcall_ ## p1 asm("d3") = p1;    \
  50.         register ULONG         *selfcall_ ## p2 asm("a2") = p2;    \
  51.         register ULONG         *selfcall_ ## p3 asm("a3") = p3;    \
  52.         result = fn ();                                                 \
  53.       }
  54. #endif /* GCC section */
  55.  
  56.  
  57.  
  58. /****** Beast.h/BST_Class [0.1]
  59. *
  60. *    NAME
  61. *      BST_Class -- a beast class
  62. *
  63. ************************************
  64. */
  65. struct BST_Class
  66. {
  67.   struct Node       bc_Node;
  68.   ULONG             bc_Size;
  69.   struct MinList    bc_IntputPorts;
  70.   struct MinList    bc_OutputPorts;
  71.   struct MinList    bc_Methods;
  72.   ULONG            bc_ObjectCount;
  73.   struct Library   *bc_ExtClass;
  74.   ULONG             bc_Userdata;  /* NOT USED --  */
  75. };
  76.  
  77.  
  78. /****** Beast.h/class_MethodList [0.1]
  79. *
  80. *  NAME
  81. *    class_MethodList -- list with methods
  82. *
  83. *****************************************
  84. */
  85. struct class_MethodList
  86. {
  87.   struct MinNode  cml_Node ;
  88.   BST_Method      cml_MethodID ;
  89.   struct MinList *cml_HookList ;
  90. };
  91.  
  92.  
  93. /****** Beast.h/BST_Object [0.1]
  94. *
  95. *  NAME
  96. *    BST_Object -- a standard object
  97. *
  98. ************************************
  99. */
  100. struct BST_Object
  101. {
  102.   struct MinNode     obj_Node;
  103.   APTR             obj_DataSection;
  104.   struct MinList     obj_InputList;
  105.   struct MinList     obj_OutputList;
  106.   struct BST_Class  *obj_Class;
  107.   struct BST_Object *obj_Parent;
  108.   struct MinList     obj_Childs;
  109.   ULONG             obj_Flags;
  110. };
  111.  
  112.  
  113. /****** Beast.h/obj_InputLink [0.1]
  114. *
  115. *  NAME
  116. *    obj_InputLink --
  117. *
  118. ***********************************
  119. */
  120. struct obj_InputLink
  121. {
  122.   struct MinNode          oil_Node ;
  123.   struct BST_Object      *oil_Object ;
  124.   struct obj_OutputLink  *oil_FromMethodOOL ;
  125.   BST_Method              oil_InputMethod ;
  126. } ;
  127.  
  128. /****** Beast.h/obj_OutputLink [0.1]
  129. *
  130. *  NAME
  131. *    obj_OutputLink --
  132. *
  133. *************************************
  134. */
  135. struct obj_OutputLink
  136. {
  137.   struct MinNode         ool_Node ;
  138.   struct BST_Object     *ool_Object ;
  139.   struct obj_InputLink  *ool_ToMethodOIL ;
  140.   BST_Method             ool_OutputMethod ;
  141. } ;
  142.  
  143.  
  144.  
  145.  
  146. /****** Beast.h/BST_base [0.1]
  147. *
  148. *  NAME
  149. *    BST_base --
  150. *
  151. ******
  152. */
  153.  
  154. struct BST_base
  155. {
  156.   struct BST_Object  bb_Base ;
  157.   struct MinList     bb_DefinedClasses ;
  158. } ;
  159.  
  160.  
  161.  
  162.  
  163.  
  164. /********************************
  165.  ****                 ****
  166.  **** BEAST Standard methods ****
  167.  ****                 ****
  168.  ********************************/
  169.  
  170. #define    OBM_bits_FUNCTION 0xF0000000
  171. #define    OBM_type_None      0x00000000
  172.  
  173. #define    OBM_bits_FAMILY      0x0F000000
  174. #define    OBM_type_Plain      0x00000000
  175. #define    OBM_type_System      0x01000000
  176. #define    OBM_type_General  0x02000000
  177. #define    OBM_type_B52      0x03000000
  178. #define    OBM_type_BeaVis      0x04000000
  179. #define    OBM_type_BFS      0x05000000
  180. #define    OBM_type_BeaMM      0x06000000
  181. #define    OBM_type_BEASTAR  0x07000000
  182.  
  183.     /**** Numbers   0x0000040 - 0x000007f Free */
  184. #define OBM_local0    0x0000040
  185.     /**** Numbers   0x0000100 - 0x00007ff Free */
  186. #define OBM_local1    0x0000100
  187.     /**** Numbers     0x0004000 - 0x0004fff Free */
  188. #define OBM_local2    0x0004000
  189.     /**** Numbers   0x0100000 - 0x01fffff Free */
  190. #define    OBM_local3    0x0100000
  191.  
  192.  
  193. #define OBM_INPUT       0x0000080
  194. #define OBM_OUTPUT      0x0000081
  195. #define OBM_INPUT2      0x0000082
  196. #define OBM_OUTPUT2     0x0000083
  197. #define OBM_INPUT3      0x0000084
  198. #define OBM_OUTPUT3     0x0000085
  199. #define OBM_INPUT4      0x0000086
  200. #define OBM_OUTPUT4     0x0000087
  201. #define OBM_SYSINPUT    0x0000088
  202. #define OBM_SYSOUTPUT   0x0000089
  203. #define OBM_IDCMPINPUT    0x000008A
  204. #define OBM_IDCMPOUTPUT    0x000008B
  205. #define OBM_BVSINPUT    0x000008C
  206. #define OBM_BVSOUTPUT    0x000008D
  207. #define OBM_BEAMMINPUT  0x000008E
  208. #define OBM_BEAMMOUTPUT    0x000008F
  209. #define OBM_BFSINPUT    0x0000090
  210. #define    OBM_BFSOUTPUT    0x0000091
  211.  
  212. #define    OBM_ALLOCMEM    0x0000100
  213. #define    OBM_FREEMEM    0x0000101
  214. #define    OBM_LOCKMEM    0x0000102
  215. #define    OBM_UNLOCKMEM    0x0000103
  216.  
  217.  
  218. #define OBM_GETATTR     0x0001000
  219. #define OBM_SETATTR     0x0001001
  220.  
  221. #define OBM_INIT        0x0040000
  222. #define OBM_DISPOSE     0x0040001
  223.  
  224. /**********************************
  225.  **** Beast General classes methods
  226.  ****/
  227. #define    OBM_GETEACH    0x0000000|OBM_bits_System
  228. #define    OBM_FOREACH    0x0000001|OBM_bits_System
  229.  
  230.  
  231. /***********************************
  232.  ****                     ****
  233.  **** BEAST Standard Attributes ****
  234.  ****                     ****
  235.  ***********************************/
  236.  
  237. #define BST_bits_System    0x7F000000
  238. #define BST_TAG (TAG_USER+0x40000000)
  239.  
  240. #define BTB_Ignore        29
  241. #define BTF_Ignore        (1L<<29)
  242. #define    BTB_Attributes        28
  243. #define BTF_Attributes        (1L<<28)
  244. #define BTB_UserTag        27
  245. #define BTF_UserTag        (1L<<27)
  246.  
  247. #define    BST_bits_Types        0x00F00000
  248. #define    BTA_type_Plain        0x00000000
  249. #define    BTA_type_CString    0x00100000
  250. #define    BTA_type_Object        0x00200000
  251. #define    BTA_type_Pointer    0x00300000
  252.  
  253. /************
  254.  **** Control
  255.  ****/
  256. #define BTA_CONTROL        BST_TAG|BTF_Attributes|0x000
  257. #define    BTA_NumberOf        BTA_CONTROL+0x01
  258.  
  259. /*************
  260.  **** Position
  261.  ****/
  262. #define BTA_POSITION        BST_TAG|BTF_Attributes|0x100
  263. #define    BTA_X            BTA_POSITION+0x00|BTA_type_Plain
  264. #define    BTA_Y            BTA_POSITION+0x01|BTA_type_Plain
  265. #define    BTA_Width        BTA_POSITION+0x02|BTA_type_Plain
  266. #define BTA_Height        BTA_POSITION+0x03|BTA_type_Plain
  267. #define    BTA_Size        BTA_POSITION+0x04|BTA_type_Plain
  268.  
  269. /**********
  270.  **** Types
  271.  ****/
  272. #define    BTA_TYPES        BST_TAG|BTF_Attributes|0x200
  273. #define BTA_LongNumber        BTA_TYPES+0x00
  274.  
  275. /***************
  276.  **** Identifier
  277.  ****/
  278. #define    BTA_IDENTIFIER        BST_TAG|BTF_Attributes|0x300
  279. #define    BTA_Title        BTA_IDENTIFIER+0x00|BTA_type_CString
  280. #define    BTA_MainObject        BTA_IDENTIFIER+0x01|BTA_type_Object
  281. #define    BTA_Object1        BTA_IDENTIFIER+0x02|BTA_type_Object
  282. #define    BTA_Object2        BTA_IDENTIFIER+0x03|BTA_type_Object
  283. #define    BTA_Object3        BTA_IDENTIFIER+0x04|BTA_type_Object
  284. #define    BTA_Object4        BTA_IDENTIFIER+0x05|BTA_type_Object
  285. #define    BTA_Object5        BTA_IDENTIFIER+0x06|BTA_type_Object
  286. #define    BTA_Object6        BTA_IDENTIFIER+0x07|BTA_type_Object
  287. #define    BTA_Object7        BTA_IDENTIFIER+0x08|BTA_type_Object
  288. #define    BTA_Object8        BTA_IDENTIFIER+0x09|BTA_type_Object
  289. #define    BTA_Object9        BTA_IDENTIFIER+0x0A|BTA_type_Object
  290. #define    BTA_Method        BTA_IDENTIFIER+0x0B|BTA_type_Plain
  291. #define    BFS_UserName        BTA_IDENTIFIER+0x0C|BTA_type_CString
  292.  
  293. /***********
  294.  **** System
  295.  ****/
  296. #define    BTA_SYSTEM        BST_TAG|BTF_Attributes|0x400
  297. #define    BTA_MemBlock        BTA_SYSTEM+0x00|BTA_type_Pointer
  298. #define    BTA_MemHandle        BTA_SYSTEM+0x01|BTA_type_Pointer
  299. #define    BTA_MemFlags        BTA_SYSTEM+0x02|BTA_type_Plain
  300. #define        MEMB_MOVEABLE        25
  301. #define        MEMF_MOVEABLE        (1L<<25)
  302. #define        MEMB_DISCARDABLE    26
  303. #define        MEMF_DISCARDABLE    (1L<<26)
  304.  
  305. /**********************************************
  306.  **** Method Flags for the OBJ_DoMethod routine
  307.  ****/
  308.  
  309. #define MTHF_DOCHILDREN        0x00000001
  310. #define MTHF_DOPARENTS        0x00000002
  311. #define MTHF_DISPOSED         0x00000004    /* INTERNAL: Somewhere an object must be disposed */
  312. #define MTHF_EVENTDISPOSE    0x00000008     /* INTERNAL: MUST be used in combination with the MTHF_DISPOSED
  313.                            flag, now *also* the eventobject will be disposed. */
  314. #define MTHF_PASSTOCHILD    0x00000010
  315.  
  316. #define    MTHF_ERROR          0x00000040
  317. #define MTHF_FATALERROR        0x00000080
  318. #define MTHF_BREAK        0x00000100
  319.  
  320. #define    MTHF_B52_bits        0x0000F000    /* Methodflags used by B52 */
  321.  
  322. /*****************
  323.  **** Beast macros
  324.  ****/
  325. #define eq ==
  326. #define Macro_GetInstance Object->obj_DataSection;
  327. #define Macro_SetAttr( Structure, Attribute ) case Attribute: Structure = cur_ti->ti_Data; break;
  328. #define Macro_GetAttr( Structure, Attribute ) case Attribute: cur_ti->ti_Data = Structure; break;
  329.  
  330. #endif     /* BEAST_BEAST_H */
  331.